import { createWebHistory, createRouter, createWebHashHistory } from 'vue-router'

import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'

//导航的五个组件
import ArticleCategoryVue from '@/views/article/ArticleCategory.vue'
import ArticleManageVue from '@/views/article/ArticleManage.vue'
import UserAvatarVue from '@/views/user/UserAvatar.vue'
import UserInfoVue from '@/views/user/UserInfo.vue'
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue'

const routes = [
	{
		path: '/Login',

		component: LoginVue
	},
	{
		path: '/',
		component: LayoutVue,
		redirect: '/article/category',
		children: [
			{ path: '/article/category', component: ArticleCategoryVue },
			{ path: '/article/manage', component: ArticleManageVue },
			{ path: '/user/avatar', component: UserAvatarVue },
			{ path: '/user/info', component: UserInfoVue },
			{ path: '/user/resetpassword', component: UserResetPasswordVue }

		]
	},
]

// createWebHistory不要直接复制文档中的那个history对象
const router = createRouter({
	history: createWebHashHistory(),
	routes,
})

export default router